import trees

myDatas, labels = trees.createDataSet()
print myDatas
print labels

# shannonEnt = trees.calcShannonEnt(myDatas)
# print shannonEnt

# print trees.splitDataSet(myDatas, 0, 0)
# print trees.splitDataSet(myDatas, 0, 1)

# print trees.chooseBestFeatureToSplit(myDatas)

# myTree = trees.createTree(myDatas, labels)
# trees.storeTree(myTree, "myTree")

myTree = trees.grabTree("myTree")
print myTree
# treePlotter.createPlot(myTree)
# print labels
# print myTree.keys()

label1 = trees.classify(myTree, labels, [1, 0])
print label1

label2 = trees.classify(myTree, labels, [1, 1])
print label2

# fr = open('lenses.txt')
# lenses = [inst.strip().split('\t') for inst in fr.readlines()]
# lensesLabels = ['age', 'prescript', 'astigmatic', 'tearRate']
# lensesTree = trees.createTree(lenses, lensesLabels)
# print lensesTree
#
# treePlotter.createPlot(lensesTree)
